package com.project.filetsystem.config;


import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.Arrays;
import java.util.List;

/**
 * @ClassName WebConfigurer
 * @Author YellowMouse
 * @Date 2021/3/26
 * @Version 1.0
 * <p>
 * 需要拦截那些路径
 **/
@Configuration
public class WebConfigurer implements WebMvcConfigurer {
    private static final List<String> EXCLUDE_PATH = Arrays.asList("/", "css/**", "js/**", "img/**", "json/**", "fonts/**","/*.html");
    //上面这个"/*.html"是放行所有static下面的html文件

    // 这个方法是用来配置静态资源的，比如html，js，css，等等
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
    }

}

